home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92c.txt / 000029_icon-group-sender _Mon Oct 19 16:24:16 1992.msg < prev    next >
Internet Message Format  |  1993-01-04  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Tue, 20 Oct 1992 09:17:38 MST
  2. Date: 19 Oct 92 16:24:16 GMT
  3. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  4. Organization: University of Chicago Computing Organizations
  5. Subject: Re: sortf - sortff?
  6. Message-Id: <1992Oct19.162416.28966@midway.uchicago.edu>
  7. References: <1992Oct14.050320.9087@midway.uchicago.edu>, <1992Oct19.092116.18168@eua.ericsson.se>
  8. Sender: icon-group-request@cs.arizona.edu
  9. To: icon-group@cs.arizona.edu
  10. Status: R
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12.  
  13. konhks@eua.ericsson.se writes:
  14.  
  15. >>Version 8 of Icon has sortf.  Seems useful.  But what if you want to
  16. >
  17. >'sortf'? Ain't heard of no such thing.
  18.  
  19. It's in the specs for the latest version.  Sortf, I believe, is 8.6+.  A
  20. very useful tool.  I kinda wish it had arbitrary final arguments, i.e.
  21. sortf(struct, 1) would sort on field 1, while sortf(struct, 1, 2) would
  22. sort on field 1, and for objects with the same field one, on field 2 as
  23. well.  This would be easy to prototype if there were, in addition to the
  24. === a >>>= and <<<= operator, defined to work on structures as well as
  25. cset, strings, ints, and reals.  I think that symmetry requires such
  26. operators, and that, because there is no need to restrict sortf to one
  27. field, it should not be so restricted.
  28.  
  29. I've written an Icon prototype of sortf that takes arbitrary arguments if
  30. anyone wants it.  It calls sortf, though, to determine sort order, so it
  31. is slow.  If there were <<<=, etc. I'd have been able to do a manual merge
  32. or quicksort+insertion sort, which might or might not have been faster.  I
  33. still haven't fully figured RTL out, or I might have tried implementing it
  34. as part of the run-time system.
  35.  
  36. >When I do more complex sorting jobs I write a file and run Unix 'sort' on it.
  37.  
  38. That would be fine except that, under some conditions, it's considered bad
  39. programming practice to use platform-specific facilities.  UNIX is certainly
  40. not the only OS I use, or plan to use, so in my particular case piping output
  41. through sort is not an ideal solution.
  42.  
  43. -- 
  44.  
  45.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  46.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  47.